home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / include / RCS / resource.h,v < prev    next >
Encoding:
C/C++ Source or Header  |  1990-02-15  |  3.1 KB  |  107 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     90.02.14.16.17.34;  author tve;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @Original X11R4 distribution
  17. @
  18.  
  19.  
  20.  
  21. 1.1
  22. log
  23. @Initial revision
  24. @
  25. text
  26. @/* $XConsortium: resource.h,v 1.10 89/07/19 09:34:49 rws Exp $ */
  27. /***********************************************************
  28. Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts,
  29. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  30.  
  31.                         All Rights Reserved
  32.  
  33. Permission to use, copy, modify, and distribute this software and its 
  34. documentation for any purpose and without fee is hereby granted, 
  35. provided that the above copyright notice appear in all copies and that
  36. both that copyright notice and this permission notice appear in 
  37. supporting documentation, and that the names of Digital or MIT not be
  38. used in advertising or publicity pertaining to distribution of the
  39. software without specific, written prior permission.  
  40.  
  41. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  42. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  43. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  44. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  45. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  46. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  47. SOFTWARE.
  48.  
  49. ******************************************************************/
  50. #ifndef RESOURCE_H
  51. #define RESOURCE_H 1
  52. #include "misc.h"
  53.  
  54. /*****************************************************************
  55.  * STUFF FOR RESOURCES 
  56.  *****************************************************************/
  57.  
  58. /* classes for Resource routines */
  59.  
  60. typedef unsigned long RESTYPE;
  61.  
  62. #define RC_VANILLA    ((RESTYPE)0)
  63. #define RC_CACHED    ((RESTYPE)1<<31)
  64. #define RC_DRAWABLE    ((RESTYPE)1<<30)
  65. #define RC_LASTPREDEF    RC_DRAWABLE
  66. #define RC_ANY        (~(RESTYPE)0)
  67.  
  68. /* types for Resource routines */
  69.  
  70. #define RT_WINDOW    ((RESTYPE)1|RC_CACHED|RC_DRAWABLE)
  71. #define RT_PIXMAP    ((RESTYPE)2|RC_CACHED|RC_DRAWABLE)
  72. #define RT_GC        ((RESTYPE)3|RC_CACHED)
  73. #define RT_FONT        ((RESTYPE)4)
  74. #define RT_CURSOR    ((RESTYPE)5)
  75. #define RT_COLORMAP    ((RESTYPE)6)
  76. #define RT_CMAPENTRY    ((RESTYPE)7)
  77. #define RT_OTHERCLIENT    ((RESTYPE)8)
  78. #define RT_PASSIVEGRAB    ((RESTYPE)9)
  79. #define RT_LASTPREDEF    RT_PASSIVEGRAB
  80. #define RT_NONE        ((RESTYPE)0)
  81.  
  82. /* bits and fields within a resource id */
  83. #define CLIENTOFFSET 20                    /* client field */
  84. #define RESOURCE_ID_MASK    0x7FFFF            /* low 19 bits */
  85. #define CLIENT_BITS(id) ((id) & 0xfff00000)        /* hi 12 bits */
  86. #define CLIENT_ID(id) ((int)(CLIENT_BITS(id) >> CLIENTOFFSET))    /* hi 12 bits */
  87. #define SERVER_BIT        0x80000            /* 20th bit reserved */
  88. #define SERVER_BIT_SHIFT    19            /* 20th bit reserved */
  89.  
  90. /* Invalid resource id */
  91. #define INVALID    (0)
  92.  
  93. #define BAD_RESOURCE 0xe0000000
  94.  
  95. RESTYPE CreateNewResourceType();
  96. RESTYPE CreateNewResourceClass();
  97. unsigned long FakeClientID();
  98. Bool AddResource();
  99. void FreeResource();
  100. void FreeClientResources();
  101. Bool LegalNewID();
  102. pointer LookupIDByType();
  103. pointer LookupIDByClass();
  104.  
  105. #endif /* RESOURCE_H */
  106. @
  107.